package com.itgaoshu.hospitalproject.service.impl;

import com.itgaoshu.hospitalproject.bean.Lrecord;
import com.itgaoshu.hospitalproject.bean.Pay;
import com.itgaoshu.hospitalproject.bean.Register;
import com.itgaoshu.hospitalproject.mapper.LPayMapper;
import com.itgaoshu.hospitalproject.service.LPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class LPayServiceImpl implements LPayService {
    @Autowired
    private LPayMapper lPayMapper;

    //查询该患者的缴费项目根据患者id来查询
    @Override
    public List<Pay> selPays(Register register) {
        return lPayMapper.selPays(register);
    }

    //添加预交金的操作
    @Override
    public int updatePay(Register register) {
        return lPayMapper.updatePay(register);
    }

    //添加记录的操作
    @Override
    public int addPay(Register register) {
        return lPayMapper.addPay(register);
    }

    //查询该患者还有多少钱
    @Override
    public List<Lrecord> selSurplus(Lrecord lrecord) {
        return lPayMapper.selSurplus(lrecord);
    }
}
